package org.i77soft.games.MineSweeperAcer;

import java.util.ArrayList;

///*
import org.i77soft.games.MineSweeperAcer.gameState;
import org.i77soft.games.MineSweeperAcer.gameState_instructions;
import org.i77soft.games.MineSweeperAcer.gameState_mainMenu;
import org.i77soft.games.MineSweeperAcer.gameState_playingGame;
import org.i77soft.games.MineSweeperAcer.gameState_selectDifficulty;
import org.i77soft.games.MineSweeperAcer.gameState_submitHighScore;
import org.i77soft.games.MineSweeperAcer.gameState_titleScreen;
//*/

public class gameStateManager {

    int currentState;

    private ArrayList<gameState> gameStates;

    private static gameStateManager instance;

    public static final int GS_TITLESCREEN = 0;

    public static final int GS_MAINMENU = 1;

    public static final int GS_INSTRUCTIONS = 2;

    public static final int GS_PLAYINGGAME = 3;

    public static final int GS_SUBMITHIGHSCORE = 4;

    public static final int GS_SELECTDIFFICULTY = 5;

    private gameStateManager() {
        gameStates = new ArrayList<gameState>();
        currentState = 0;
        /*
        gameStates.add(new gameState_titleScreen());
        gameStates.add(new gameState_mainMenu());
        gameStates.add(new gameState_instructions());
        gameStates.add(new gameState_playingGame());
        gameStates.add(new gameState_submitHighScore());
        gameStates.add(new gameState_selectDifficulty());
        //*/
    }

    public int getCurrentGameStateIndex() {
        return currentState;
    }

    public void setCurrentState(int i) {
        currentState = i;
    }

    public gameState getCurrentGameState() {
        if (currentState == -1)
            return null;
        if (currentState >= gameStates.size())
            return null;
        else
            return (gameState) gameStates.get(currentState);
    }

    public static gameStateManager gi() {
        return instance;
    }

    public static void init() {
        instance = new gameStateManager();
    }
}